<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
  <%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="<%=basePath%>Js/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/mycss/bootstrap.min.css" />
</head>
<script type="text/javascript">
function selectKaifanRecord(){
	
	var vipNumber = "";
	var vipName = "";
	var vipIdNumber = "";
	var vipNumber = $("#vipNumber").val();
	var vipName = $("#vipName").val();
	var vipIdNumber = $("#vipIdNumber").val();
	
	window.location.href="selectKaifanRecord2.do?vipNumber="+vipNumber+"&vipName="+vipName+"&vipIdNumber="+vipIdNumber;
}


</script>
<body>
<hr><h3 align="center">开房记录</h3><hr>

<div>
<table>
<tr>
<td>会员卡号：</td>
<td><input type="text" class="form-control" id="vipNumber" placeholder="请输入会员卡号"></td>
<td>姓名：</td>
<td><input type="text" class="form-control" id="vipName" placeholder="请输入姓名"></td>
<td>身份证号码：</td>
<td><input type="text" class="form-control" id="vipIdNumber" placeholder="请输入身份证号码"></td>
<td><button onclick="selectKaifanRecord()" type="button" class="btn btn-success">查询</button></td>
</tr>
</table>

<br>
</div>

	<table class="table table-bordered">
		<tr>
			<th>姓名</th>
			<th>账号</th>
			<th>房间号</th>
			<th>房型</th>
			<th>价格</th>
			<th>入住人数</th>
			<th>身份证号码</th>
			<th>居住地址</th>
			<th>开房办理人</th>
			<th>开房时间</th>
			<th>退房时间</th>
			<th>退房办理人</th>
			<th>备注</th>
		</tr>
		
		<c:forEach items="${pageInfo.list}" var="kaifanList">
		<tr>
			<td>${kaifanList.name}</td>
			<td>${kaifanList.number}</td>
			<td>${kaifanList.roomnumber}</td>
			<td>${kaifanList.type}</td>
			<td>${kaifanList.price}</td>
			<td>${kaifanList.quantity}</td>
			<td>${kaifanList.idnumber}</td>
			<td>${kaifanList.address}</td>
			<td>${kaifanList.transactor}</td>
			<td>${kaifanList.reserved2}</td>
				<c:choose>
					<c:when test="${kaifanList.reserved3 eq null}">
						<td style="color:#C9302C">未退房</td>
					</c:when>
					<c:otherwise>
						<td>${kaifanList.reserved3}</td>
					</c:otherwise>
				</c:choose>
			
			<td>${kaifanList.reserved1}</td>
			<td>${kaifanList.remarks}</td>
		</tr>
		</c:forEach>

	</table>

<c:if test="${inf eq null}">
	<div id="page1">
		<c:if test="${!pageInfo.isFirstPage }">
			<a href="${pageContext.request.contextPath }/queryKaifangRecordAll.do?vipNumber=${vipNumber}&vipName=${vipName}&vipIdNumber=${vipIdNumber}">首页</a>
			<a
				href="${pageContext.request.contextPath }/queryKaifangRecordAll.do?pageNum=${pageInfo.prePage}&vipNumber=${vipNumber}&vipName=${vipName}&vipIdNumber=${vipIdNumber}">上一页</a>
		</c:if>
		<c:if test="${!pageInfo.isLastPage }">
			<a
				href="${pageContext.request.contextPath }/queryKaifangRecordAll.do?pageNum=${pageInfo.nextPage}&vipNumber=${vipNumber}&vipName=${vipName}&vipIdNumber=${vipIdNumber}">下一页</a>
			<a
				href="${pageContext.request.contextPath }/queryKaifangRecordAll.do?pageNum=${pageInfo.lastPage}&vipNumber=${vipNumber}&vipName=${vipName}&vipIdNumber=${vipIdNumber}">末页</a>
		</c:if>
		当前页：${pageInfo.pageNum }/${pageInfo.pages }.
	</div>
</c:if>

<c:if test="${!(inf eq null)}">
	<div id="page1">
		<c:if test="${!pageInfo.isFirstPage }">
			<a href="${pageContext.request.contextPath }/selectKaifanRecord2.do">首页</a>
			<a
				href="${pageContext.request.contextPath }/selectKaifanRecord2.do?pageNum=${pageInfo.prePage}">上一页</a>
		</c:if>
		<c:if test="${!pageInfo.isLastPage }">
			<a
				href="${pageContext.request.contextPath }/selectKaifanRecord2.do?pageNum=${pageInfo.nextPage}">下一页</a>
			<a
				href="${pageContext.request.contextPath }/selectKaifanRecord2.do?pageNum=${pageInfo.lastPage}">末页</a>
		</c:if>
		当前页：${pageInfo.pageNum }/${pageInfo.pages }.
	</div>
</c:if>

</body>
</html>